Solve  \[\frac{x^2+x+1}{x+1}=x+2\]for $x$.
Explanation: Cross-multiplication gives  \[x^2+x+1=(x+2)(x+1)=x^2+3x+2.\]Therefore \[0=2x+1\]and $x=\boxed{-\frac12}$.